package top.ninwoo.utils.util;

import top.ninwoo.utils.entity.ChainEntity;
import top.ninwoo.utils.entity.ChainType;
import top.ninwoo.utils.entity.TableType;

import java.util.List;
import java.util.Map;

/**
 * @Author joliu
 * @Description
 * @Date　Create in 下午10:37 2019/10/28
 */
public interface IptablesUtils {
    Map<String, List<ChainEntity>> showIptablesDetail(String containerId);

    Map<String, List<ChainEntity>> showIptablesDetail(String containerId, String type);

    String addIptable(String containerId, String kind, ChainType chainType, String source, String destination, String policy);

    String delIptable(String containerId, ChainType chainType, String source, String destination, String policy);

    String delIptable(String containerId, TableType tableType, ChainType chainType, int lineNumber);

    String supperiseCmd(String containerId, String cmd);

    boolean modifyIptable(String containerId, ChainType chainType, String source, String destination, String policy, int lineNumber);

    boolean flushIptables(String containerId, ChainType chainType);
    // 添加一个iptables项
    // 删除一个iptables项

    // 查看iptables条目
}
